import request from '@/utils/request'
import qs from 'qs'
import { jdyadmin } from '@/settings'

/**
 * 采购管理 
 */

// 供应商列表
export function getGongying(data){
  return request({
    url: `${jdyadmin}/jdySupplier/seleteJdySupplier`,
    method: 'post',
    data
  })
}

// 新增供应商
export function addGongying(data){
  return request({
    url: `${jdyadmin}/jdySupplier/addJdySupplier`,
    method: 'post',
    data
  })
}

// 修改供应商
export function updateGongying(data){
  return request({
    url: `${jdyadmin}/jdySupplier/updateJdySupplier`,
    method: 'post',
    data
  })
}

// 删除供应商
export function deleteGongying(data){
  return request({
    url: `${jdyadmin}/jdySupplier/deleteJdySupplier/${data}`,
    method: 'delete'
  })
}

/**
 * -------------------------------------------------------
 * ------------------------采购操作------------------------
 * -------------------------------------------------------
 */
// 新增商品信息
export function addProduct(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/addJdyCommodity`,
    method: 'post',
    data
  })
}

// 新增采购信息
export function addCaigou(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/addJdyPurchase`,
    method: 'post',
    data
  })
}

// 删除采购商品信息
export function deleteProduct(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/deleteJdyCommodity/${data}`,
    method: 'delete'
  })
}

// 删除采购信息
export function deleteCaigou(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/deleteJdyPurchase/${data}`,
    method: 'delete'
  })
}

// 采购商品信息查询
export function selectProduct(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/seleteJdyCommodityDto`,
    method: 'post',
    data
  })
}

// 采购查询
export function selectCaigou(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/seleteAllJdyPurchase`,
    method: 'post',
    data
  })
}

// 更新采购和商品信息
export function updateCaigouOrPro(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/updateAllPurchase`,
    method: 'post',
    data
  })
}

// 更新采购商品信息
export function updatePro(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/updatejdyCommodity`,
    method: 'post',
    data
  })
}

// 更新采购表头信息
export function updateCaigouHeader(data){
  return request({
    url: `${jdyadmin}/jdyPurchase/updatejdyPurchase`,
    method: 'post',
    data
  })
}




/**
 * ---------------------------------------------------------------------
 * -------------------------------资产管理-------------------------------
 * ---------------------------------------------------------------------
 */
// 根据id搜索维保信息
export function idSearchDetail(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/seletseleteShebeiID`,
		method: 'post',
		data
	})
}

// 系统设置,下拉框新增修改管理
// 系统设置管理
export function getSeting(data){
	return request({
		url: `${jdyadmin}/starchSystemSet/seleteJdySupplier`,
		method: 'post',
		data
	})
}

// 新增系统设置
export function addSeting(data){
	return request({
		url: `${jdyadmin}/starchSystemSet/addJdySupplier`,
		method: 'post',
		data
	})
}

// 修改系统设置
export function updateSeting(data){
	return request({
		url: `${jdyadmin}/starchSystemSet/updateJdySupplier`,
		method: 'post',
		data
	})
}

// 删除系统设置
export function deleteSeting(id){
	return request({
		url: `${jdyadmin}/starchSystemSet/deleteJdySupplier/${id}`,
		method: 'delete'
	})
}


/**
 * --------------------------------
 * ------------分类管理-------------
 * --------------------------------
 */
// 分类管理
export function getFenlei(data){
	return request({
		url: `${jdyadmin}/warehouseDepository/seleteFenleiJdyFlowCatalog`,
		method: 'post',
		data
	})
}

// 新增分类
export function addFenlei(data){
	return request({
		url: `${jdyadmin}/warehouseDepository/addWarehouseAccess`,
		method: 'post',
		data
	})
}
// 修改分类
export function updateFenlei(data){
	return request({
		url: `${jdyadmin}/warehouseDepository/updateWarehouseAccess`,
		method: 'post',
		data
	})
}
// 删除分类
export function deleteFenlei(id){
	return request({
		url: `${jdyadmin}/warehouseDepository/deleteWarehouseAccess/${id}`,
		method: 'delete'
	})
}



// 资产生成二维码
export function createEwm(data){
	return request({
		url: `${jdyadmin}/departmentFacility/detailserweima`,
		method: 'post',
		data
	})
}

/**
 * ------------------------------------------
 * ----------------子设备分类-----------------
 * ------------------------------------------
 */
// 分类管理
export function getziFenlei(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtype/seletSubDetails`,
		method: 'post',
		data
	})
}
// 新增子设备分类
export function addziFenlei(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtype/addStarchManageCheck`,
		method: 'post',
		data
	})
}
// 修改分类
export function updateziFenlei(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtype/updateStarchManageCheck`,
		method: 'post',
		data
	})
}
// 删除分类
export function deleteziFenlei(id){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtype/deleteStarchManageCheck/${id}`,
		method: 'delete'
	})
}

/**
 * --------------------------------
 * -----------各部门资产------------
 * --------------------------------
 */
export function gebumenZichan(){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/seletFenleiGeBumenShiyong`,
		method: 'get'
	})
}


/**
 * --------------------------------
 * ------------入库管理-------------
 * --------------------------------
 */
// 批量导入资产
export function importZichan(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/addFacilityexcle`,
		method: 'post',
		data
	})
}

// 查询未使用资产
export function selectWeishiyong(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/seletStarcYIQuerenhManageCheck`,
		method: 'post',
		data
	})
}


// 增加入库
export function addRuku(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/addStarchManageCheck`,
		method: 'post',
		data
	})
}

// 更新入库单信息
export function updateRuku(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/updateStarchManageCheck`,
		method: 'post',
		data
	})
}

// 入库单列表
export function rukuList(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/seletStarchManageCheck`,
		method: 'post',
		data
	})
}

// 删除入库信息
export function deleteRuku(id){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/deleteStarchManageCheck/${id}`,
		method: 'delete'
	})
}

/**
 * ------------------------
 * -------子设备信息--------
 * ------------------------
 */
// 增加子设备信息
export function addZishebei(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtypeAsset/addStarchManageCheck`,
		method: 'post',
		data
	})
}

// 更新子设备信息
export function updateZishebei(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtypeAsset/updateStarchManageCheck`,
		method: 'post',
		data
	})
}

// 子设备信息
export function zishebeiList(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtypeAsset/seletSubDetails`,
		method: 'post',
		data
	})
}

// 删除子设备信息
export function deleteZishebei(id){
	return request({
		url: `${jdyadmin}/starchOrganizationPutSubtypeAsset/deleteStarchManageCheck/${id}`,
		method: 'delete'
	})
}




/**
 * ------------------------
 * -------领用与退库--------
 * ------------------------
 */

// 领用退库修改状态
export function updateStatusLingTui(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccess/updateZhuangtaiStarchManageCheck`,
		method: 'post',
		data
	})
}

 // 添加领用与退库
export function addLingTUi(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccess/addStarchManageCheck`,
		method: 'post',
		data
	})
}

// 更新领用与退库
export function updateLingTUi(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccess/updateStarchManageCheck`,
		method: 'post',
		data
	})
}

// 领用与退库列表
export function selectLingTUi(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccess/seletRelevanceStarchManageCheck`,
		method: 'post',
		data
	})
}

// 删除领用与退库
export function deleteLingTUi(id){
	return request({
		url: `${jdyadmin}/starchOrganizationAccess/deleteStarchManageCheck/${id}`,
		method: 'delete'
	})
}

/**
 * ------------------------
 * ------清理报废商品-------
 * ------------------------
 */

// 添加清理报废商品
export function addBaofei(data){
	return request({
		url: `${jdyadmin}/starchPropertyScrap/addStarchManageCheck`,
		method: 'post',
		data
	})
}

// 更新清理报废商品
export function updateBaofei(data){
	return request({
		url: `${jdyadmin}/starchPropertyScrap/updateStarchManageCheck`,
		method: 'post',
		data
	})
}

// 清理报废商品列表
export function selectBaofei(data){
	return request({
		url: `${jdyadmin}/starchPropertyScrap/seletRelevanceStarchOrganizationProvoke`,
		method: 'post',
		data
	})
}

// 删除清理报废商品
export function deleteBaofei(id){
	return request({
		url: `${jdyadmin}/starchPropertyScrap/deleteStarchManageCheck/${id}`,
		method: 'delete'
	})
}

/**
 * ------------------------
 * ------资产维修登记-------
 * ------------------------
 */
// 根据名字搜索所要检修的设备
export function idSearchShebei(data){
	return request({
		url: `${jdyadmin}/starchMaintainRegister/seletJianxiuMaintainRegisterDto`,
		method: 'post',
		data
	})
}
// 单一维修登记评价
export function weixiupingjia(data){
	return request({
		url: `${jdyadmin}/starchMaintainRegister/updatesSingleJdyFlowCatalog`,
		method: 'post',
		data
	})
}


// 根据设备id查询维修记录信息
export function idSelectWeixiu(id){
	return request({
		url: `${jdyadmin}/starchMaintainRegister/seletByZichan/${id}`,
		method: 'get'
	})
}

// 添加资产维修登记
export function addWeixiu(data){
	return request({
		url: `${jdyadmin}/starchMaintainRegister/addJdyFlowCatalog`,
		method: 'post',
		data
	})
}

// 更新资产维修登记
export function updateWeixiu(data){
	return request({
		url: `${jdyadmin}/starchMaintainRegister/updateStarchMaintainRegister`,
		method: 'post',
		data
	})
}

// 资产维修登记列表
export function selectWeixiu(data){
	return request({
		url: `${jdyadmin}/starchMaintainRegister/seletRelevanceStarchMaintainRegisterDto`,
		method: 'post',
		data
	})
}

// 删除资产维修登记
export function deleteWeixiu(id){
	return request({
		url: `${jdyadmin}/starchMaintainRegister/deleteStockDepository/${id}`,
		method: 'delete'
	})
}


/**
 * ---------------------------
 * ------资产维保信息变更-------
 * ---------------------------
 */
// 添加资产维保信息变更
export function addWeibao(data){
	return request({
		url: `${jdyadmin}/starchMaintenanceAlteration/addtarchMaintenanceAlteration`,
		method: 'post',
		data
	})
}

// 更新资产维保信息变更
export function updateWeibao(data){
	return request({
		url: `${jdyadmin}/starchMaintenanceAlteration/updatetarchMaintenanceAlteration`,
		method: 'post',
		data
	})
}

// 资产维保信息变更列表
export function selectWeibao(data){
	return request({
		url: `${jdyadmin}/starchMaintenanceAlteration/seletetarchMaintenanceAlteration`,
		method: 'post',
		data
	})
}

// 删除资产维保信息变更
export function deleteWeibao(id){
	return request({
		url: `${jdyadmin}/starchMaintenanceAlteration/deletetarchMaintenanceAlteration/${id}`,
		method: 'delete'
	})
}

/**
 * ------------------------
 * ------资产信息变更-------
 * ------------------------
 */
// 添加资产信息变更
export function addZichanbiangeng(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAlteration/addStarchManageCheck`,
		method: 'post',
		data
	})
}

// 更新资产信息变更
export function updateZichanbiangeng(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAlteration/updateStarchManageCheck`,
		method: 'post',
		data
	})
}

// 资产信息变更列表
export function selectZichanbiangeng(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAlteration/seletStarchManageCheck`,
		method: 'post',
		data
	})
}

// 删除资产信息变更
export function deleteZichanbiangeng(id){
	return request({
		url: `${jdyadmin}/starchOrganizationAlteration/deleteStarchManageCheck/${id}`,
		method: 'delete'
	})
}


/**
 * ------------------------
 * --------资产调拨---------
 * ------------------------
 */
// 添加资产调拨
export function addDiaobo(data){
	return request({
		url: `${jdyadmin}/starchOrganizationProvoke/addStarchManageCheck`,
		method: 'post',
		data
	})
}

// 更新资产调拨
export function updateDiaobo(data){
	return request({
		url: `${jdyadmin}/starchOrganizationProvoke/updateStarchManageCheck`,
		method: 'post',
		data
	})
}

// 资产调拨列表
export function selectDiaobo(data){
	return request({
		url: `${jdyadmin}/starchOrganizationProvoke/seletRelevanceStarchOrganizationProvoke`,
		method: 'post',
		data
	})
}

// 删除资产调拨
export function deleteDiaobo(id){
	return request({
		url: `${jdyadmin}/starchOrganizationProvoke/deleteStarchManageCheck/${id}`,
		method: 'delete'
	})
}

/**
 * ---------------------------------------------------------------------
 * -------------------------------耗材管理-------------------------------
 * ---------------------------------------------------------------------
 */
/**
 * ------------------------------
 * --------出入库页面管理---------
 * ------------------------------
 */
// 添加入库单
export function addHaocaiRuku(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccessConsumable/addStarchConsumable`,
		method: 'post',
		data
	})
}

// 更新入库单
export function updateHaocaiRuku(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccessConsumable/updateStarchConsumable`,
		method: 'post',
		data
	})
}

// 入库单列表
export function selectHaocaiRuku(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccessConsumable/seletStarchConsumable`,
		method: 'post',
		data
	})
}

// 删除入库单
export function deleteHaocaiRuku(id){
	return request({
		url: `${jdyadmin}/starchOrganizationAccessConsumable/deleteStarchConsumable/${id}`,
		method: 'delete'
	})
}


/**
 * ----------------------------
 * --------耗材分类管理---------
 * ----------------------------
 */
// 添加耗材分类
export function addHaocaiFenlei(data){
	return request({
		url: `${jdyadmin}/starchClassifyPutConsumable/addStarchClassifyPut`,
		method: 'post',
		data
	})
}

// 更新耗材分类
export function updateHaocaiFenlei(data){
	return request({
		url: `${jdyadmin}/starchClassifyPutConsumable/updateStarchClassifyPut`,
		method: 'post',
		data
	})
}

// 耗材分类列表
export function selectHaocaiFenlei(data){
	return request({
		url: `${jdyadmin}/starchClassifyPutConsumable/seletStarchClassifyPut`,
		method: 'post',
		data
	})
}

// 删除耗材分类
export function deleteHaocaiFenlei(id){
	return request({
		url: `${jdyadmin}/starchClassifyPutConsumable/deleteStarchClassifyPutService/${id}`,
		method: 'delete'
	})
}

/**
 * ----------------------------
 * --------耗材资产管理---------
 * ----------------------------
 */
// 添加耗材资产
export function addHaocaiZichan(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutConsumable/addStarchOrganizationPutConsumable`,
		method: 'post',
		data
	})
}

// 更新耗材资产
export function updateHaocaiZichan(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutConsumable/updateStarchOrganizationPutConsumable`,
		method: 'post',
		data
	})
}

// 耗材分类列表
export function selectHaocaiZichan(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutConsumable/seletStarchOrganizationPutConsumable`,
		method: 'post',
		data
	})
}

// 删除耗材分类
export function deleteHaocaiZichan(id){
	return request({
		url: `${jdyadmin}/starchOrganizationPutConsumable/deleteStarchOrganizationPutConsumable/${id}`,
		method: 'delete'
	})
}

/**
 * ---------------------------------------
 * ---------------借用&&归还 --------------
 * --------------------------------------- 
 */
export function addJieyong(data){
	return request({
		url: `${jdyadmin}/starchOrganizationBorrowReturn/addStarchManageCheck`,
		method: 'post',
		data
	})
}

//借用&更改列表

export function jieyongList(data){
	return request({
		url: `${jdyadmin}/starchOrganizationBorrowReturn/seletRelevanceStarchOrganizationBorrowReturn`,
		method: 'post',
		data
	})
}
//更改借用为已归还
export function updateJieyong(data){
	return request({
		url: `${jdyadmin}/starchOrganizationBorrowReturn/updateStarchManageCheck`,
		method: 'post',
		data
	})
}
//更改借用为已归还
export function updateJieyongNew(data){
	return request({
		url: `${jdyadmin}/starchOrganizationBorrowReturn/updateBiaotouStarchManageCheck`,
		method: 'post',
		data
	})
}

// 耗材领用退库确认
export function haocaiLingTui(data){
	return request({
		url: `${jdyadmin}/starchOrganizationAccessConsumable/addStarchQuerenConsumable`,
		method: 'post',
		data
	})
}


// 耗材出入库资产信息
export function haocaiLingTuiZichan(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutConsumableChuru/selearchConsumable`,
		method: 'post',
		data
	})
}

//部门耗材修改接口
export function updateBumenhaocai(data){
	return request({
		url: `${jdyadmin}/starchOrganizationPutConsumableChuru/updateSinglesStarchManageCheck`,
		method: 'post',
		data
	})
}



/**
 * ----------------------文件上传----------------------
 */
export function uploadFile(data,config) {
  return request({
    url: `${jdyadmin}/jdyFileUpload/upload`,
    config,
    method: 'post',
    data
  })
}
export function gebumenshiyong(){
	return request({
		url: `${jdyadmin}/starchOrganizationPut/seletFenleiBumenShiyong`,
		method: 'get'
	})
}

